/*
 * Created on 23/04/2008
 * 
 */
package com.apbetioli.mapr.util;

import com.apbetioli.mapr.place.schema.PlacesManager;
import com.apbetioli.mapr.project.schema.ProjectsManager;
import com.apbetioli.mapr.util.properties.PropertiesLoaderImpl;

/**
 *
 * @author Alexandre Parra Betioli
 */
public enum ErrorsEnum {

    WRONG_INPUT( 
            PropertiesLoaderImpl.getValue("messages.properties", "error.wrongInput.message"), 
            PropertiesLoaderImpl.getValue("messages.properties", "error.wrongInput.details") ),

    PROJECT_NOT_FOUND( 
            PropertiesLoaderImpl.getValue("messages.properties", "error.projectNotFound.message"),
            PropertiesLoaderImpl.getValue("messages.properties", "error.projectNotFound.details") );

    private String message;
    private String details;    
    
    ErrorsEnum( final String message, final String details ) {
        this.message = message;
        this.details = details;
    }

    public ProjectsManager getProjectsManagerError() {
        
        ProjectsManager error = new ProjectsManager();
        
        com.apbetioli.mapr.project.schema.CtError e = new com.apbetioli.mapr.project.schema.CtError();
        e.setMessage(this.message);
        e.setDetails(this.details);
        
        error.setError(e);
        
        return error;
    }
    
    public PlacesManager getPlacesManagerError() {
        
        PlacesManager error = new PlacesManager();
        
        com.apbetioli.mapr.place.schema.CtError e = new com.apbetioli.mapr.place.schema.CtError();
        e.setMessage(this.message);
        e.setDetails(this.details);
        
        error.setError(e);
        
        return error;
    }    
}
